using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Decisions.HL7.Message;
using DecisionsFramework;

namespace Decisions.HL7.Message
{
    public class MessageStructureAttribute:RuleAttribute
    {
        private Dictionary<HL7Version, string[]> validVersionCodes = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, string[]> validVersionDescriptions = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, HL7TableType> tableVersionTypes = new Dictionary<HL7Version, HL7TableType>();

        public MessageStructureAttribute()
        {
            // init the values for table version types
						tableVersionTypes[HL7Version.v231] = HL7TableType.HL7;
						tableVersionTypes[HL7Version.v24] = HL7TableType.HL7;
						tableVersionTypes[HL7Version.v25] = HL7TableType.HL7;
						tableVersionTypes[HL7Version.v251] = HL7TableType.HL7;
						tableVersionTypes[HL7Version.v26] = HL7TableType.HL7;
						tableVersionTypes[HL7Version.v27] = HL7TableType.HL7;
			
            
			// init the values for version codes
						validVersionCodes[HL7Version.v231] = new string[]{"ACK","ORS_O02","RDO_O01","RRO_O02","OMD_O01","OMN_O01","OMS_O01","ORD_O02","ORN_O02","ADT_A01","ADT_A02","ADT_A03","ADT_A06","ADT_A09","ADT_A12","ADT_A16","ADT_A17","ADT_A18","ADT_A20","ADT_A24","ADT_A28","ADT_A30","ADT_A37","ADT_A38","ADT_A39","ADT_A43","ADT_A45","ADT_A50","ARD_A19","BAR_P01","BAR_P02","BAR_P06","CRM_C01","CSU_C09","DFT_P03","DOC_T12","DSR_Q01","DSR_Q03","EDR_R07","EQQ_Q04","ERP_R09","MDM_T01","MDM_T02","MFD_P09","MFK_M01","MFN_M01","MFN_M02","MFN_M03","MFN_M05","MFN_M06","MFN_M07","MFN_M08","MFN_M09","MFN_M10","MFN_M11","NUL","ORF_R02","ORM_O01","ORM_Q06","ORR_O02","ORR_Q06","ORU_R01","ORU_W01","OSQ_Q06","OSR_Q06","PEX_P07","PGL_PC6","PIN_I07","PPG_PCG","PPP_PCB","PPR_PC1","PPT_PCL","PPV_PCA","PRR_PC5","PTR_PCF","QCK_Q02","QRY_A19","QRY_PC4","QRY_Q01","QRY_Q02","QRY_R02","QRY_T12","RAR_RAR","RAS_O01","RAS_O02","RCI_I05","RCL_I06","RDE_O01","RDR_RDR","RDS_O01","REF_I12","RER_RER","RGR_RGR","RGV_O01","ROR_ROR","RPA_I08","RPI_I0I","RPL_I02","RPR_I03","RQA_I08","RQC_I05","RQC_I06","RQI_I0I","RQP_I04","RQQ_Q09","RRA_O02","RRD_O02","RRE_O02","RRG_O02","RRI_I12","SIU_S12","SPQ_Q08","SQM_S25","SQR_S25","SRM_S01","SRM_T12","SRR_S01","SRR_T12","SUR_P09","TBR_R09","UDM_Q05","VQQ_Q07","VXQ_V01","VXR_V03","VXU_V04","VXX_V02"};
						validVersionCodes[HL7Version.v24] = new string[]{"ACK","ADT_A01","ADT_A02","ADT_A03","ADT_A05","ADT_A06","ADT_A09","ADT_A15","ADT_A16","ADT_A17","ADT_A18","ADT_A20","ADT_A24","ADT_A30","ADT_A37","ADT_A38","ADT_A39","ADT_A43","ADT_A45","ADT_A50","ADT_A52","ADT_A54","ADT_A60","ADT_A61","ADR_A19","BAR_P01","BAR_P02","BAR_P05","BAR_P06","BAR_P10","CRM_C01","CSU_C09","DFT_P03","DOC_T12","DSR_Q01","DSR_Q03","EAC_U07","EAN_U09","EAR_U08","EDR_R07","EQQ_Q04","ERP_R09","ESR_U02","ESU_U01","INR_U06","INU_U05","LSU_U12","MDM_T01","MDM_T02","MFD_MFA","MFK_M01","MFN_M01","MFN_M02","MFN_M03","MFN_M04","MFN_M05","MFN_M06","MFN_M07","MFN_M08","MFN_M09","MFN_M10","MFN_M11","MFN_M12","MFQ_M01","MFR_M01","NMD_N02","NMQ_N01","NMR_N01","OMD_O03","OMG_O19","OML_O21","OMN_O07","OMP_O09","OMS_O05","ORD_O04","ORF_R04","ORG_O20","ORM_O01","ORP_O10","ORR_O02","ORS_O06","ORU_R01","ORU_W01","OSQ_Q06","OSR_Q06","PEX_P07","PGL_PC6","PMU_B01","PMU_B03","PMU_B04","PPG_PCG","PPP_PCB","PPR_PC1","PPT_PCL","PPV_PCA","PRR_PC5","PTR_PCF","QCK_Q02","QCN_J01","QRY_A19","QRY_PC4","QRY_Q01","QRY_Q02","QBP_Q21","QRY_R02","QRY_T12","QSB_Q16","QVR_Q17","RAR_RAR","RAS_O17","RCI_I05","RCL_I06","RDE_O11","RDR_RDR","RDS_O13","REF_I12","RER_RER","RGR_RGR","RGV_O15","ROR_ROR","RPA_I08","RPI_I01","RPL_I02","RPR_I03","RQA_I08","RQC_I05","RQI_I01","RQP_I04","RQQ_Q09","RRA_O18","RRD_O14","RRE_O12","RRG_O16","RRI_I12","RSP_K21","RSP_K22","RSP_K23","SIU_S12","SPQ_Q08","SQM_S25","SQR_S25","SRM_S01","SRR_S01","SSR_U04","SSU_U03","SUR_P09","TCU_U10","UDM_Q05","VQQ_Q07","VXQ_V01","VXR_V03","VXU_V04","VXX_V02","ADT_A21","QBP_Q11","QBP_Q13","QBP_Q15","RDY_K11","RTB_K13","RDY_K15","TBR_R08","RPI_I04","RSP_K24","RSP_K25","DSR_P04","OUL_R21","ORN_O08","ORL_O22"};
						validVersionCodes[HL7Version.v25] = new string[]{"ACK","ADR_A19","ADT_A01","ADT_A02","ADT_A03","ADT_A05","ADT_A06","ADT_A09","ADT_A15","ADT_A16","ADT_A17","ADT_A18","ADT_A20","ADT_A21","ADT_A24","ADT_A30","ADT_A37","ADT_A38","ADT_A39","ADT_A43","ADT_A45","ADT_A50","ADT_A52","ADT_A54","ADT_A60","ADT_A61","BAR_P01","BAR_P02","BAR_P05","BAR_P06","BAR_P10","BAR_P12","BPS_O29","BRP_030","BRT_O32","BTS_O31","CRM_C01","CSU_C09","DFT_P03","DFT_P11","DOC_T12","DSR_P04","DSR_Q01","DSR_Q03","EAC_U07","EAN_U09","EAR_U08","EDR_R07","EQQ_Q04","ERP_R09","ESR_U02","ESU_U01","INR_U06","INU_U05","LSU_U12","MDM_T01","MDM_T02","MFD_MFA","MFK_M01","MFN_M01","MFN_M02","MFN_M03","MFN_M04","MFN_M05","MFN_M06","MFN_M07","MFN_M08","MFN_M09","MFN_M10","MFN_M11","MFN_M12","MFN_M13","MFN_M15","MFQ_M01","MFR_M01","NMD_N02","NMQ_N01","NMR_N01","OMB_O27","OMD_O03","OMG_O19","OMI_O23","OML_O21","OML_O33","OML_O35","OMN_O07","OMP_O09","OMS_O05","ORB_O28","ORD_O04","ORF_R04","ORG_O20","ORI_O24","ORL_O22","ORL_O34","ORL_O36","ORM_O01","ORN_O08","ORP_O10","ORR_O02","ORS_O06","ORU_R01","ORU_R30","ORU_R31","ORU_R32","OSQ_Q06","OSR_Q06","OUL_R21","OUL_R22","OUL_R23","OUL_R24","PEX_P07","PGL_PC6","PMU_B01","PMU_B03","PMU_B04","PMU_B07","PMU_B08","PPG_PCG","PPP_PCB","PPR_PC1","PPT_PCL","PPV_PCA","PRR_PC5","PTR_PCF","QBP_Q11","QBP_Q13","QBP_Q15","QBP_Q21","QCK_Q02","QCN_J01","QRY_A19","QRY_P04","QRY_PC4","QRY_Q01","QRY_Q02","QRY_R02","QRY_T12","QSB_Q16","QVR_Q17","RAR_RAR","RAS_O17","RCI_I05","RCL_I06","RDE_O01","RDE_O11","RDR_RDR","RDS_O13","RDY_K15","REF_I12","RER_RER","RGR_RGR","RGV_O15","ROR_ROR","RPA_I08","RPI_I01","RPL_I02","RPR_I03","RQA_I08","RQC_I05","RQI_I01","RQP_I04","RQQ_Q09","RRA_O02","RRA_O18","RRD_O14","RRE_O12","RRG_O16","RRI_I12","RSP_K11","RSP_K21","RSP_K22","RSP_K23","RTB_K13","SIU_S12","SPQ_Q08","SQM_S25","SQR_S25","SRM_S01","SRR_S01","SSR_U04","SSU_U03","SUR_P09","TBR_R08","TBR_R09","TCU_U10","UDM_Q05","VQQ_Q07","VXQ_V01","VXR_V03","VXU_V04","VXX_V02","ORU_W01","QRF_W02"};
						validVersionCodes[HL7Version.v251] = new string[]{"ACK","ADR_A19","ADT_A01","ADT_A02","ADT_A03","ADT_A05","ADT_A06","ADT_A09","ADT_A12","ADT_A15","ADT_A16","ADT_A17","ADT_A18","ADT_A20","ADT_A21","ADT_A24","ADT_A30","ADT_A37","ADT_A38","ADT_A39","ADT_A43","ADT_A45","ADT_A50","ADT_A52","ADT_A54","ADT_A60","ADT_A61","BAR_P01","BAR_P02","BAR_P05","BAR_P06","BAR_P10","BAR_P12","BPS_O29","BRP_O30","BRT_O32","BTS_O31","CRM_C01","CSU_C09","DFT_P03","DFT_P11","DOC_T12","DSR_P04","DSR_Q01","DSR_Q03","EAC_U07","EAN_U09","EAR_U08","EDR_R07","EQQ_Q04","ERP_R09","ESR_U02","ESU_U01","INR_U06","INU_U05","LSU_U12","MDM_T01","MDM_T02","MFD_MFA","MFK_M01","MFN_M01","MFN_M02","MFN_M03","MFN_M04","MFN_M05","MFN_M06","MFN_M07","MFN_M08","MFN_M09","MFN_M10","MFN_M11","MFN_M12","MFN_M13","MFN_M15","MFQ_M01","MFR_M01","MFR_M04","MFR_M05","MFR_M06","MFR_M07","NMD_N02","NMQ_N01","NMR_N01","OMB_O27","OMD_O03","OMG_O19","OMI_O23","OML_O21","OML_O33","OML_O35","OMN_O07","OMP_O09","OMS_O05","ORB_O28","ORD_O04","ORF_R04","ORG_O20","ORI_O24","ORL_O22","ORL_O34","ORL_O36","ORM_O01","ORN_O08","ORP_O10","ORR_O02","ORS_O06","ORU_R01","ORU_R30","OSQ_Q06","OSR_Q06","OUL_R21","OUL_R22","OUL_R23","OUL_R24","PEX_P07","PGL_PC6","PMU_B01","PMU_B03","PMU_B04","PMU_B07","PMU_B08","PPG_PCG","PPP_PCB","PPR_PC1","PPT_PCL","PPV_PCA","PRR_PC5","PTR_PCF","QBP_Q11","QBP_Q13","QBP_Q15","QBP_Q21","QCK_Q02","QCN_J01","QRY_A19","QRY_P04","QRY_PC4","QRY_Q01","QRY_Q02","QRY_R02","QRY_T12","QSB_Q16","QVR_Q17","RAR_RAR","RAS_O17","RCI_I05","RCL_I06","RDE_O11","RDR_RDR","RDS_O13","RDY_K15","REF_I12","RER_RER","RGR_RGR","RGV_O15","ROR_ROR","RPA_I08","RPI_I01","RPI_I04","RPL_I02","RPR_I03","RQA_I08","RQC_I05","RQI_I01","RQP_I04","RQQ_Q09","RRA_O18","RRD_O14","RRE_O12","RRG_O16","RRI_I12","RSP_K11","RSP_K21","RSP_K22","RSP_K23","RSP_K25","RSP_K31","RSP_Q11","RTB_K13","SIU_S12","SPQ_Q08","SQM_S25","SQR_S25","SRM_S01","SRR_S01","SSR_U04","SSU_U03","SUR_P09","TBR_R08","TBR_R09","TCU_U10","UDM_Q05","VQQ_Q07","VXQ_V01","VXR_V03","VXU_V04","VXX_V02","ORU_W01","QRF_W02"};
						validVersionCodes[HL7Version.v26] = new string[]{"ACK","ADR_A19","ADT_A01","ADT_A02","ADT_A03","ADT_A05","ADT_A06","ADT_A09","ADT_A12","ADT_A15","ADT_A16","ADT_A17","ADT_A18","ADT_A20","ADT_A21","ADT_A24","ADT_A30","ADT_A37","ADT_A38","ADT_A39","ADT_A43","ADT_A45","ADT_A50","ADT_A52","ADT_A54","ADT_A60","ADT_A61","BAR_P01","BAR_P02","BAR_P05","BAR_P06","BAR_P10","BAR_P12","BPS_O29","BRP_O30","BRT_O32","BTS_O31","CRM_C01","CSU_C09","DFT_P03","DFT_P11","DOC_T12","DSR_Q01","DSR_Q03","EAC_U07","EAN_U09","EAR_U08","EHC_E01","EHC_E02","EHC_E04","EHC_E10","EHC_E12","EHC_E13","EHC_E15","EHC_E20","EHC_E21","EHC_E24","ESR_U02","ESU_U01","INR_U06","INU_U05","LSU_U12","MDM_T01","MDM_T02","MFK_M01","MFN_M01","MFN_M02","MFN_M03","MFN_M04","MFN_M05","MFN_M06","MFN_M07","MFN_M08","MFN_M09","MFN_M10","MFN_M11","MFN_M12","MFN_M13","MFN_M15","MFN_M16","MFN_M17","MFQ_M01","MFR_M01","MFR_M04","MFR_M05","MFR_M06","MFR_M07","NMD_N02","NMQ_N01","NMR_N01","OMB_O27","OMD_O03","OMG_O19","OMI_O23","OML_O21","OML_O33","OML_O35","OMN_O07","OMP_O09","OMS_O05","OPL_O37","OPR_O38","OPU_R25","ORB_O28","ORD_O04","ORF_R04","ORG_O20","ORI_O24","ORL_O22","ORL_O34","ORL_O36","ORM_O01","ORN_O08","ORP_O10","ORR_O02","ORS_O06","ORU_R01","ORU_R30","OSQ_Q06","OSR_Q06","OUL_R21","OUL_R22","OUL_R23","OUL_R24","PEX_P07","PGL_PC6","PMU_B01","PMU_B03","PMU_B04","PMU_B07","PMU_B08","PPG_PCG","PPP_PCB","PPR_PC1","PPT_PCL","PPV_PCA","PRR_PC5","PTR_PCF","QBP_E03","QBP_E22","QBP_Q11","QBP_Q13","QBP_Q15","QBP_Q21","QCK_Q02","QCN_J01","QRY_A19","QRY_PC4","QRY_Q01","QRY_Q02","QRY_R02","QRY_T12","QSB_Q16","QVR_Q17","RAR_RAR","RAS_O17","RCI_I05","RCL_I06","RDE_O11","RDR_RDR","RDS_O13","RDY_K15","REF_I12","RER_RER","RGR_RGR","RGV_O15","ROR_ROR","RPA_I08","RPI_I01","RPI_I04","RPL_I02","RPR_I03","RQA_I08","RQC_I05","RQI_I01","RQP_I04","RRA_O18","RRD_O14","RRE_O12","RRG_O16","RRI_I12","RSP_E03","RSP_E22","RSP_K11","RSP_K21","RSP_K23","RSP_K25","RSP_K31","RSP_Q11","RTB_K13","SDR_S31","SDR_S32","SIU_S12","SLR_S28","SQM_S25","SQR_S25","SRM_S01","SRR_S01","SSR_U04","SSU_U03","STC_S33","SUR_P09","TCU_U10","UDM_Q05","VXQ_V01","VXR_V03","VXU_V04","VXX_V02","ORU_W01","QRF_W02"};
						validVersionCodes[HL7Version.v27] = new string[]{"ACK","ADR_A19","ADT_A01","ADT_A02","ADT_A03","ADT_A05","ADT_A06","ADT_A09","ADT_A12","ADT_A15","ADT_A16","ADT_A17","ADT_A18","ADT_A20","ADT_A21","ADT_A24","ADT_A30","ADT_A37","ADT_A38","ADT_A39","ADT_A43","ADT_A44","ADT_A45","ADT_A50","ADT_A52","ADT_A54","ADT_A60","ADT_A61","BAR_P01","BAR_P02","BAR_P05","BAR_P06","BAR_P10","BAR_P12","BPS_O29","BRP_O30","BRT_O32","BTS_O31","CCF_I22","CCI_I22","CCM_I21","CCQ_I19","CCR_I16","CCU_I20","CQU_I19","CRM_C01","CSU_C09","DFT_P03","DFT_P11","DOC_T12","EAC_U07","EAN_U09","EAR_U08","EHC_E01","EHC_E02","EHC_E04","EHC_E10","EHC_E12","EHC_E13","EHC_E15","EHC_E20","EHC_E21","EHC_E24","ESR_U02","ESU_U01","INR_U06","INU_U05","LSU_U12","MDM_T01","MDM_T02","MFK_M01","MFN_M01","MFN_M02","MFN_M03","MFN_M04","MFN_M05","MFN_M06","MFN_M07","MFN_M08","MFN_M09","MFN_M10","MFN_M11","MFN_M12","MFN_M13","MFN_M15","MFN_M16","MFN_M17","MFQ_M01","MFR_M01","MFR_M04","MFR_M05","MFR_M06","MFR_M07","NMD_N02","NMQ_N01","NMR_N01","OMB_O27","OMD_O03","OMG_O19","OMI_O23","OML_O21","OML_O33","OML_O35","OML_O39","OMN_O07","OMP_O09","OMS_O05","OPL_O37","OPR_O38","OPU_R25","ORA_R33","ORB_O28","ORD_O04","ORF_R04","ORG_O20","ORI_O24","ORL_O22","ORL_O34","ORL_O36","ORL_O40","ORM_O01","ORN_O08","ORP_O10","ORR_O02","ORS_O06","ORU_R01","ORU_R30","OSM_R26","OSQ_Q06","OSR_Q06","OUL_R21","OUL_R22","OUL_R23","OUL_R24","PEX_P07","PGL_PC6","PMU_B01","PMU_B03","PMU_B04","PMU_B07","PMU_B08","PPG_PCG","PPP_PCB","PPR_PC1","PPT_PCL","PPV_PCA","PRR_PC5","PTR_PCF","QBP_E03","QBP_E22","QBP_Q11","QBP_Q13","QBP_Q15","QBP_Q21","QCK_Q02","QCN_J01","QRY_A19","QRY_PC4","QRY_Q01","QRY_Q02","QRY_R02","QRY_T12","QSB_Q16","QVR_Q17","RAR_RAR","RAS_O17","RCI_I05","RCL_I06","RDE_O11","RDR_RDR","RDS_O13","RDY_K15","REF_I12","RER_RER","RGR_RGR","RGV_O15","ROR_ROR","RPA_I08","RPI_I01","RPI_I04","RPL_I02","RPR_I03","RQA_I08","RQC_I05","RQI_I01","RQP_I04","RRA_O18","RRD_O14","RRE_O12","RRG_O16","RRI_I12","RSP_E03","RSP_E22","RSP_K11","RSP_K21","RSP_K22","RSP_K23","RSP_K25","RSP_K31","RSP_K32","RSP_Q11","RTB_K13","SDR_S31","SDR_S32","SIU_S12","SLR_S28","SQM_S25","SQR_S25","SRM_S01","SRR_S01","SSR_U04","SSU_U03","STC_S33","SUR_P09","TCU_U10","UDM_Q05","VXQ_V01","VXR_V03","VXU_V04","VXX_V02","ORU_W01","QRF_W02","MFN_Znn","QBP_Z73","RSP_Z82","RSP_Z86","RSP_Z88","RSP_Z90","RTB_Knn","RTB_Z74","QBP_Qnn"};
			
			// init the values for version descriptions
						validVersionDescriptions[HL7Version.v231] = new string[]{"","","","","","","","","","A01, A04, A05, A08, A13, A14, A28, A31","A02, A21, A22, A23, A25, A26, A27, A29, A32, A33","A03","A06, A07","A09, A10, A11, A15","A12","A16","A17","A18","A20","A24","A28, A31","A30, A34, A35, 136, A46, A47, A48, A49","A37","A38","A39, A40, A41, A42","A43, A44","A45","A50, A51","A19","P01, P05","P02","P06","C01, C02, C03, C04, C05, C06, C07, C08","C09, C10, C11, C12","P03","T12","Q01","Q03","R07","Q04","R09","T01, T03, T05, T07, T09, T11","T02, T04, T06, T08, T10","P09","M01, M03, M05, M06, M07, M08, M09, M10, M11","M01","M02","M03","M05","M06","M07","M08","M09","M10","M11","Null","R02, R04","O01","Q06","O02","Q06","R01","W01","Q06","Q06","P07, P08","PC6, PC7, PC8","I07","PCC, PCH, PCJ","PCB, PCD","PC1, PC2, PC3","PCL","PCA","PC5","PCF","Q02","A19","PC4, PC9, PCE, PCK","Q01","Q02","R02, R04","T12","RAR","O01","O022","I05","I06","O01","RDR","O01","I12, I13, I14, I15","RER","RGR","O01","ROR","I08, I09. I10, 1II","I01, I04","I02","I03","I08, I09, I10, I11","I05","I06","I01, I02, I03","I04","Q09","O02","O02","O02","O02","I12, I13, I14, I15","S12, S13, S14, S15, S16, S17, S18, S19, S20, S21, S22, S23, S24, S26","Q08","S25","S25","S01, S02, S03, S04, S05, S06, S07, S08, S09, S10, S11","T12","S01, S02, S03, S04, S05, S06, S07, S08, S09, S10, S11","T12","P09","R09","Q05","Q07","V01","V03","V04","V02"};
						validVersionDescriptions[HL7Version.v24] = new string[]{"Varies","A01, A04, A08, A13","A02","A03","A05, A14, A28, A31","A06, A07","A09, A10, A11, A12","A15","A16","A17","A18","A20","A24","A30, A34, A35, A36, A46, A47, A48, A49","A37","A38","A39, A40, A41, A42","A43, A44","A45","A50, A51","A52, A53, A55","A54","A60","A61, A62","A19","P01","P02","P05","P06","P10","C01, C02, C03, C04, C05, C06, C07, C08","C09, C10, C11, C12","P03","T12","Q01","Q03","U07","U09","U08","R07","Q04","R09","U02","U01","U06","U05","U12, U13","T01, T03, T05, T07, T09, T11","T02, T04, T06, T08, T10","MFA","M01, M02, M03, M04, M05, M06, M07, M08, M09, M10, M11","M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12","M01-M06","M01-M06","N02","N01","N01","O03","O19","O21","O07","O09","O05","O04","R04","O20","O01","O10","O02","O06","R01","W01","Q06","Q06","P07, P08","PC6, PC7, PC8","B01, B02","B03","B04, B05","PCG, PCH, PCJ","PCB, PCC, PCD","PC1, PC2, PC3","PCL","PCA","PC5","PCF","Q02","J01, J02","A19","PC4, PC9, PCE, PCK","Q01","Q02","Q21, Q22, Q23, Q24, Q25","R02","T12","Q16","Q17","RAR","O17","I05","I06","O11","RDR","O13","I12, I13, I14, I15","RER","RGR","O15","ROR","I08, I09. I10, 1II","I01, I04","I02","I03","I08, I09, I10, I11","I05, I06","I01, I02, I03, I07","I04","Q09","O18","O14","O12","O16","I12, I13, I14, I15","K21","K22","K23, K24","S12, S13, S14, S15, S16, S17, S18, S19, S20, S21, S22, S23, S24, S26","Q08","S25","S25","S01, S02, S03, S04, S05, S06, S07, S08, S09, S10, S11","S01, S02, S03, S04, S05, S06, S07, S08, S09, S10, S11","U04","U03","P09","U10, U11","Q05","Q07","V01","V03","V04","V02","A21, A22, A23, A25, A26, A27, A29, A32, A33","Q11","Q13","Q15","K11","K13","K15","R08","I04","K24","K25","P04","R21","O08","O22"};
						validVersionDescriptions[HL7Version.v25] = new string[]{"Varies","A19","A01, A04, A08, A13","A02","A03","A05, A14, A28, A31","A06, A07","A09, A10, A11, A12","A15","A16","A17","A18","A20","A21, A22, A23, A25, A26, A27, A29, A32, A33","A24","A30, A34, A35, A36, A46, A47, A48, A49","A37","A38","A39, A40, A41, A42","A43, A44","A45","A50, A51","A52, A53, A55","A54","A60","A61, A62","P01","P02","P05","P06","P10","P12","O29","O30","O32","O31","C01, C02, C03, C04, C05, C06, C07, C08","C09, C10, C11, C12","P03","P11","T12","P04","Q01","Q03","U07","U09","U08","R07","Q04","R09","U02","U01","U06","U05","U12, U13","T01, T03, T05, T07, T09, T11","T02, T04, T06, T08, T10","MFA","M01, M02, M03, M04, M05, M06, M07, M08, M09, M10, M11","M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12","M13","M15","M01, M02, M03, M04, M05, M06","M01, M02, M03, M04, M05, M06","N02","N01","N01","O27","O03","O19","O23","O21","O33","O35","007","O09","O05","O28","O04","R04","O20","O24","022","O34","O36","O01","O08","O10","O02","O06","R01","R30","R31","R32","Q06","Q06","R21","R22","R23","R24","P07, P08","PC6, PC7, PC8","B01, B02","B03","B04, B05, B06","B07","B08","PCC, PCG, PCH, PCJ","PCB, PCD","PC1, PC2, PC3","PCL","PCA","PC5","PCF","Q11","Q13","Q15","Q21, Q22, Q23,Q24, Q25","Q02","J01, J02","A19","P04","PC4, PC9, PCE, PCK","Q01, Q26, Q27, Q28, Q29, Q30","Q02","R02","T12","Q16","Q17","RAR","O17","I05","I06","O01","O11, O25","RDR","O13","K15","I12, I13, I14, I15","RER","RGR","O15","ROR","I08, I09. I10, I11","I01, I04","I02","I03","I08, I09, I10, I11","I05, I06","I01, I02, I03, I07","I04","Q09","O02","O18","O14","O12, O26","O16","I12, I13, I14, I15","K11","K21","K22","K23, K24","K13","S12, S13, S14, S15, S16, S17, S18, S19, S20, S21, S22, S23, S24, S26","Q08","S25","S25","S01, S02, S03, S04, S05, S06, S07, S08, S09, S10, S11","S01, S02, S03, S04, S05, S06, S07, S08, S09, S10, S11","U04","U03","P09","R08","R09","U10, U11","Q05","Q07","V01","V03","V04","V02","W01","W02"};
						validVersionDescriptions[HL7Version.v251] = new string[]{"Varies","A19","A01, A04, A08, A13","A02","A03","A05, A14, A28, A31","A06, A07","A09, A10, A11","A12","A15","A16","A17","A18","A20","A21, A22, A23, A25, A26, A27, A29, A32, A33","A24","A30, A34, A35, A36, A46, A47, A48, A49","A37","A38","A39, A40, A41, A42","A43, A44","A45","A50, A51","A52, A53, A55","A54","A60","A61, A62","P01","P02","P05","P06","P10","P12","O29","O30","O32","O31","C01, C02, C03, C04, C05, C06, C07, C08","C09, C10, C11, C12","P03","P11","T12","P04","Q01","Q03","U07","U09","U08","R07","Q04","R09","U02","U01","U06","U05","U12, U13","T01, T03, T05, T07, T09, T11","T02, T04, T06, T08, T10","MFA","M01, M02, M03, M04, M05, M06, M07, M08, M09, M10, M11","M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12","M13","M15","M01, M02, M03, M04, M05, M06","M01, M02, M03","M04","Mo5","M06","M07","N02","N01","N01","O27","O03","O19","O23","O21","O33","O35","007","O09","O05","O28","O04","R04","O20","O24","022","O34","O36","O01","O08","O10","O02","O06","R01","R30, R31, R32","Q06","Q06","R21","R22","R23","R24","P07, P08","PC6, PC7, PC8","B01, B02","B03","B04, B05, B06","B07","B08","PCC, PCG, PCH, PCJ","PCB, PCD","PC1, PC2, PC3","PCL","PCA","PC5","PCF","Q11","Q13","Q15","Q21, Q22, Q23,Q24, Q25","Q02","J01, J02","A19","P04","PC4, PC9, PCE, PCK","Q01, Q26, Q27, Q28, Q29, Q30","Q02","R02","T12","Q16","Q17","RAR","O17","I05","I06","O11, O25","RDR","O13","K15","I12, I13, I14, I15","RER","RGR","O15","ROR","I08, I09. I10, I11","I01","I04","I02","I03","I08, I09, I10, I11","I05, I06","I01, I02, I03, I07","I04","Q09","O18","O14","O12, O26","O16","I12, I13, I14, I15","K11","K21","K22","K23, K24","K25","K31","Q11","K13","S12, S13, S14, S15, S16, S17, S18, S19, S20, S21, S22, S23, S24, S26","Q08","S25","S25","S01, S02, S03, S04, S05, S06, S07, S08, S09, S10, S11","S01, S02, S03, S04, S05, S06, S07, S08, S09, S10, S11","U04","U03","P09","R08","R09","U10, U11","Q05","Q07","V01","V03","V04","V02","W01","W02"};
						validVersionDescriptions[HL7Version.v26] = new string[]{"Varies","A19","A01, A04, A08, A13","A02","A03","A05, A14, A28, A31","A06, A07","A09, A10, A11","A12","A15","A16","A17","A18","A20","A21, A22, A23, A25, A26, A27, A29, A32, A33","A24","A30, A34, A35, A36, A46, A47, A48, A49","A37","A38","A39, A40, A41, A42","A43, A44","A45","A50, A51","A52, A53","A54, A55","A60","A61, A62","P01","P02","P05","P06","P10","P12","O29","O30","O32","O31","C01, C02, C03, C04, C05, C06, C07, C08","C09, C10, C11, C12","P03","P11","T12","Q01","Q03","U07","U09","U08","E01","E02","E04","E10","E12","E13","E15","E20","E21","E24","U02","U01","U06","U05","U12, U13","T01, T03, T05, T07, T09, T11","T02, T04, T06, T08, T10","M01, M02, M03, M04, M05, M06, M07, M08, M09, M10, M11","M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12","M13","M15","M16","M17","M01, M02, M03, M04, M05, M06","M01, M02, M03,","M04","M05","M06","M07","N02","N01","N01","O27","O03","O19","O23","O21","O33","O35","O07","O09","O05","O37","O38","R25","O28","O04","R04","O20","O24","O22","O34","O36","O01","O08","O10","O02","O06","R01","R30","Q06","Q06","R21","R22","R23","R24","P07, P08","PC6, PC7, PC8","B01, B02","B03","B04, B05, B06","B07","B08","PCC, PCG, PCH, PCJ","PCB, PCD","PC1, PC2, PC3","PCL","PCA","PC5","PCF","E03","E22","Q11","Q13","Q15","Q21, Q22, Q23,Q24, Q25","Q02","J01, J02","A19","PC4, PC9, PCE, PCK","Q01, Q26, Q27, Q28, Q29, Q30","Q02","R02","T12","Q16","Q17","RAR","O17","I05","I06","O11, O25","RDR","O13","K15","I12, I13, I14, I15","RER","RGR","O15","ROR","I08, I09. I10, I11","I01, I04","I04","I02","I03","I08, I09, I10, I11","I05, I06","I01, I02, I03, I07","I04","O18","O14","O12, O26","O16","I12, I13, I14, I15","E03","E22","K11","K21","K23, K24","K25","K31","Q11","K13","S31, S36","S32, S37","S12, S13, S14, S15, S16, S17, S18, S19, S20, S21, S22, S23, S24, S26","S28, S29, S30, S34, S35","S25","S25","S01, S02, S03, S04, S05, S06, S07, S08, S09, S10, S11","S01, S02, S03, S04, S05, S06, S07, S08, S09, S10, S11","U04","U03","S33","P09","U10, U11","Q05","V01","V03","V04","V02","W01","W02"};
						validVersionDescriptions[HL7Version.v27] = new string[]{"Varies","","A01, A04, A08, A13","A02","A03","A05, A14, A28, A31","A06, A07","A09, A10, A11","A12","A15","A16","A17","","A20","A21, A22, A23, A25, A26, A27, A29, A32, A33","A24","","A37","A38","A39, A40, A41, A42","A43","A44","A45","A50, A51","A52, A53","A54, A55","A60","A61, A62","P01","P02","P05","P06","P10","P12","O29","O30","O32","O31","I22","I22","I21","I19","I16, |17, |18","I20","I19","C01, C02, C03, C04, C05, C06, C07, C08","C09, C10, C11, C12","P03","P11","","U07","U09","U08","E01","E02","E04","E10","E12","E13","E15","E20","E21","E24","U02","U01","U06","U05","U12, U13","T01, T03, T05, T07, T09, T11","T02, T04, T06, T08, T10","M01, M02, M03, M04, M05, M06, M07, M08, M09, M10, M11","","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12","M13","M15","M16","M17","M01, M02, M03, M04, M05, M06","M01, M02, M03,","M04","M05","M06","M07","N02","N01","N01","O27","O03","O19","O23","O21","O33","O35","O39","O07","O09","O05","O37","O38","R25","R33","O28","O04","R04","O20","O24","O22","O34","O36","O40","O01","O08","O10","O02","O06","R01","R30","R26","Q06","Q06","R21","R22","R23","R24","P07, P08","PC6, PC7, PC8","B01, B02","B03","B04, B05, B06","B07","B08","PCC, PCG, PCH, PCJ","PCB, PCD","PC1, PC2, PC3","PCL","PCA","PC5","PCF","E03","E22","Q11","Q13","Q15","Q21, Q22, Q23,Q24, Q25","Q02","J01, J02","A19","PC4, PC9, PCE, PCK","Q01, Q26, Q27, Q28, Q29, Q30","Q02","R02","T12","Q16","Q17","RAR","O17","I05","I06","O11, O25","RDR","O13","K15","I12, I13, I14, I15","RER","RGR","O15","ROR","I08, I09. I10, I11","I01, I04","I04","I02","I03","I08, I09, I10, I11","I05, I06","I01, I02, I03, I07","I04","O18","O14","O12, O26","O16","I12, I13, I14, I15","E03","E22","K11","K21","K22","K23, K24","K25","K31","K32","Q11","K13","S31, S36","S32, S37","S12, S13, S14, S15, S16, S17, S18, S19, S20, S21, S22, S23, S24, S26","S28, S29, S30, S34, S35","S25","S25","S01, S02, S03, S04, S05, S06, S07, S08, S09, S10, S11","S01, S02, S03, S04, S05, S06, S07, S08, S09, S10, S11","U04","U03","S33","P09","U10, U11","Q05","V01","V03","V04","V02","W01","W02","Znn","Z73","Z82","Z86","Z88","Z90","Knn","Z74","Qnn"};
			            

        }

        
        public override ValidationIssue[] RunRule(string name, object owningObject, object value)
        {
            //todo: check if the value is valid in the current version
            //if the value is not valid in the current version, add it as a validation issue


            return new ValidationIssue[0];
        }
    }
}
